#ifndef _IRC_H_
#define	_IRC_H_
/*******************************************************************************
 **  Name: irc.h                                         **
 **  Description:                                                             **
 **                                                                           **
 **  Open Source Initiative (OSI) Approved License                            **
 **                                                                           **
 **  Copyright (c) 2009-2010 Barry "Gian" James  <bjames@munixos.net>         **
 **  All rights reserved.                                                     **
 **                                                                           **
 **  The contents of this file are subject to the terms of the CDDL:          **
 **  Common Development and Distribution License (the "License").             **
 **  You may not use this file except in compliance with the License.         **
 **                                                                           **
 **  You can obtain a copy of the license at $PROJECT_ROOT/LICENSE            **
 **  or http://www.opensolaris.org/os/licensing.  This code is Open Source    **
 **  and you are free to use it within the confines of the license, even      **
 **  for your own closed-source commercial projects, as long as you follow    **
 **  the terms set forth in the CDDL.                                         **
 **                                                                           **
 **  When distributing Covered Code, include this CDDL HEADER in each         **
 **  file and include the License file at $PROJECT_ROOT/LICENSE.              **
 **  If applicable, add the following below this CDDL HEADER, with the        **
 **  fields enclosed by brackets "[]" replaced with your own identifying      **
 **  information: Portions Copyright [yyyy] [name of copyright owner]         **
 **                                                                           **
 ******************************************************************************/
// Created on November 23, 2010, 11:42 PM
// Modified $Date$ by $Author$
#define irc_h_ID   "$Id$"

#define IRC_CMD_NICK    "NICK bdd\r\n"
#define IRC_CMD_USER    "USER cockpit cockpit irc :BattleDroids Game Server\r\n"
#define IRC_CMD_QUIT    "QUIT :Should I be leaving?\r\n"
#define IRC_CMD_JOIN    "JOIN %s\r\n"
#define IRC_CMD_PART    "PART %s\r\n"
#define IRC_CMD_PRIVMSG "PRIVMSG %S :%s\r\n"
#define IRC_CMD_PING    "PONG :%s\r\n"

#define DEFAULT_CHANNEL "#BattleDroids"
#define DEFAULT_SERVER "irc.freenode.net"
//#define DEFAULT_SERVER  "192.168.1.100"
//#define DEFAULT_SERVER  "quadcpu"
#define DEFAULT_PORT    6667
#define IRC_MAXLINE     256

struct ircmsg
{
    ircmsg();
    ~ircmsg();
    
    char *  cmd;
    char *  from;
    char *  to;
    char *  data;
};

#endif	/* _IRC_H_ */

class IRC
{
public:
    int     Connect(const char * srv, int port);
    void    SendNick();
    void    SendUser();

    ircmsg* Parse();

private:
    int     sockfd;
};